import { defHttp } from "@/utils/http";

// ERP 标准 VO
export interface StandardVO {
	stdId: number; // 标准ID
	stdName: string; // 标准名称
	sqNumb: number; // 序号
	grpId: number; // 分组
}

// ERP 标准 API
export const StandardApi = {
	// 查询标准分页
	getStandardPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/standard/page`, params });
	},

	// 查询标准详情
	getStandard: async (id: number) => {
		return await defHttp.get({ url: `/whs/standard/get?id=` + id });
	},

	// 新增标准
	createStandard: async (data: StandardVO) => {
		return await defHttp.post({ url: `/whs/standard/create`, data });
	},

	// 修改标准
	updateStandard: async (data: StandardVO) => {
		return await defHttp.put({ url: `/whs/standard/update`, data });
	},

	// 删除标准
	deleteStandard: async (id: number) => {
		return await defHttp.delete({ url: `/whs/standard/delete?id=` + id });
	},

	// 导出标准 Excel
	exportStandard: async (params: any) => {
		return await defHttp.download({ url: `/whs/standard/export-excel`, params });
	}
};
